#!/bin/bash

#---------安装中文字符集-----------
#sudo apt-get update   //ubuntu系统更新软件包列表
#sudo apt-get install  -y language-pack-zh-hans
#sudo apt-get install -y language-pack-zh-hant
#cd /usr/share/locales
#sudo ./install-language-pack zh_CN
#---------安装中文字符集-----------


# 先要安装 sshpass
# apt-get install sshpass
# sudo apt-get install postgresql-client-12
# ----不用输入密码执行-----
# sudo visudo
# account ALL=(ALL:ALL) NOPASSWD: ALL
# ----不用输入密码执行-----
# ----docker 不用输入密码执行-----
# sudo groupadd docker
# sudo usermod -aG docker $USER
# ----docker 不用输入密码执行-----

# ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
# ssh-copy-id -i  ~/.ssh/id_rsa.pub haifeng@192.168.31.116
# ssh-copy-id -i  ~/.ssh/id_rsa.pub like@192.168.31.182
# cat ~/.ssh/id_rsa.pub | ssh haifeng@192.168.31.116  'cat >> ~/.ssh/authorized_keys'
# 把本地机器的 rsa 加入到远程机器 authorized_keys 文件里
# cat ~/.ssh/id_rsa.pub | ssh like@192.168.31.182  'cat >> ~/.ssh/authorized_keys'

start() {
  echo "--------开始安装软件--------"

  apt-get install sshpass
  if [ $? -eq 0 ]; then
    echo "--------安装完成--------"
  else
    echo $?
  fi
}

start
